<?php
class Xigg_Plugin
{
    /**
     * @var string
     * @access protected
     */
    var $_name;
    /**
     * @var string
     * @access private
     */
    var $_localeDomain;
    /**
     * @var array
     * @access protected
     */
    var $_params;
    /**
     * @var Sabai_DB
     * @access protected
     */
    var $_db;
    /**
     * @var Cache_Lite
     * @access protected
     */
    var $_cacher;

    function Xigg_Plugin($name, $dir, $params)
    {
        $this->_name = $name;
        $this->_localeDomain = strtolower($name) . '_plugin';
        $this->_params = $params;
        bindtextdomain($this->_localeDomain, $dir . '/locales');
        bind_textdomain_codeset($this->_localeDomain, SABAI_CHARSET);
    }

    /**
     * Translates a message string
     *
     * @access protected
     * @param string $msgid
     * @return string
     */
    function _($msgid)
    {
        return dgettext($this->_localeDomain, $msgid);
    }

    function setDB(&$db)
    {
        $this->_db =& $db;
    }

    function setCacher(&$cacher)
    {
        $this->_cacher =& $cacher;
    }

    function onInstall(&$result, &$error)
    {
        $result = true;
    }

    function onUninstall()
    {
    }
}